function run() {
  let min = dialogs.input('打开撸猫界面，并输入撸猫分钟', 10);
  if (!min || min < 0) {
    toastLog('无效时间');
    return;
  }
  toastLog('撸猫开始');
  let finishTime = new Date().getTime() + 60000*min;
  while (finishTime > new Date().getTime()) {
    click(device.width/2, device.height*2/5);
    sleep(100);
  }
  toastLog('撸猫结束'); 
}

run();